{% extends "partials/base.html" %}
{% block title %}Settings{% endblock %}
{% set active_page = "settings" %}
{% block content %}
    <form>
        {% for section, settings in config.to_dict().items() %}
            <p>[{{ section }}]</p>
            {% for key, value in settings.items() %}
                <div class="{% if value is not boolean %}form-floating {% endif %}mb-3">
                    {% if value is string or value is none %}
                        <input disabled class="form-control" type="text" id="{{ key }}" value="{{ value }}" placeholder>
                    {% elif value|is_list %}
                        <input disabled class="form-control" type="text" id="{{ key }}" value="{{ value|from_list }}"  placeholder>
                    {% elif value|is_dict %}
                        <input disabled class="form-control" type="text" id="{{ key }}" value="{{ value }}" placeholder>
                    {% elif value is integer %}
                        <input disabled class="form-control" type="number" id="{{ key }}" value="{{ value }}" placeholder>
                    {% elif value is boolean %}
                        <input disabled class="form-check-input" type="checkbox" id="{{ key }}"{% if value %} checked{% endif %}>
                    {% endif %}
                    <label for="{{ key }}">{{ key }}</label>
                </div>
            {% endfor %}
        {% endfor %}
    </form>
{% endblock %}
